import type {  GetPatientMylistItem, PostPatientAddData, PostPatientAddParams } from "@/types/patient"
import { request } from "@/utils/request"

/**
 * 问诊-添加患者信息
 * @param data 患者姓名,身份证号,性别,是否默认就诊人
 * @returns 返回患者 id
 */
export const postPatientAddAPI =(data:PostPatientAddParams)=>{
  return request<PostPatientAddData>('/patient/add','POST',data)
}

/*问诊-查询患者列表信息*/
export const getPatientMylistAPI=()=>{
  return request<GetPatientMylistItem[]>('/patient/mylist','GET')
}

/*问诊-删除患者*/
export const deletePatientByIdAPI =(id:string)=>{
  return request(`/patient/del/${id}`,'DELETE')
}
/**
 * 问诊-查询患者详情
 * @param id 患者 id
 * @returns 返回患者详情
 */
export const getPatientInfoByIdAPI=(id:string)=>{
  return request<GetPatientMylistItem>(`/patient/info/${id}`)
}

/**
 * 问诊-编辑患者信息
 * @param data
 * @returns
 */
export const putPatientUpdateAPI=(data:PostPatientAddParams)=>{
return request(`/patient/update`,'PUT',data)
}
